﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace day002
{
     class Program
    {
        static void Main(string[] args)
        {
            //当x，y为class类型时
            Console.WriteLine("当x，y为class类型时");
            VectorClass x, y;
            x=new VectorClass();
            x.Value = 30;
            y = x;
            Console.WriteLine("x的值为：" + x.Value);
            Console.WriteLine("y的值为："+y.Value);
            Console.WriteLine("------y=x,改变y的值后，x值也改变-----");
            y.Value = 50;
            Console.WriteLine("x的值为："+x.Value);
            Console.WriteLine("y的值为：" + y.Value);
            Console.WriteLine("----------------------------");

            //当a，b为struct类型时
            Console.WriteLine("当a，b为struct类型时");
            VectorStruct a, b;
            a = new VectorStruct();
            b = a;
            a.Value = 30;
           
            Console.WriteLine("x的值为：" + a.Value);
            Console.WriteLine("y的值为：" + b.Value);
            Console.WriteLine("------ b=a,改变b的值后，a值不变-----");
            b.Value = 50;
            Console.WriteLine("x的值为：" + a.Value);
            Console.WriteLine("y的值为：" + b.Value);






            Console.ReadKey();
        }
    }
}
